package fr.efrei.tradesys.treatments;

import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Locale;

public class Formatter
{

	public String format(double number, int fractionDigits)
	{
		Locale usaLocale = new Locale("en", "US");
		NumberFormat formatusa = DecimalFormat.getInstance(usaLocale);
		formatusa.setGroupingUsed(true);
		formatusa.setMinimumFractionDigits(fractionDigits);
		formatusa.setMaximumFractionDigits(fractionDigits);
		return formatusa.format(number);
	}

}
